# frozen_string_literal: true

require 'rails_helper'

RSpec.describe <%= @full_class_name %>, type: :action do
  subject { described_class.execute(ctx) }

  let(:ctx) do
    {
    <%- if @expects.any? -%>
    <%- @expects.each do |key| -%>
      <%= key %>: nil,
    <%- end -%>
    <%- end -%>
    }
  end

  context "when executed" do
    xit "is expected to be successful" do
      expect(subject).to be_a_success
    end
    <%- if @promises.any? -%>
    <%- @promises.each do |key| -%>

    xit "is expected to promise '<%= key %>'" do
      expect(subject.<%= key %>).to eq Some<%= key.classify %>Class
    end
    <%- end -%>
    <%- end -%>
  end
end
